package pikes.ecma;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import pikes.ecma.MemberPropertyAccess;

public class MemberPropertyAccessTestCase {

	private MockSyntaxTreeVisitor syntaxTreeVisitor = null;

	@Before
	public void setup() {
		syntaxTreeVisitor = new MockSyntaxTreeVisitor();
	}

	@Test
	public void propertyAccess() throws Exception {

		MemberPropertyAccess access = new MemberPropertyAccess("id", "prop");
		access.visit(syntaxTreeVisitor);

		Assert.assertTrue(syntaxTreeVisitor.identifier.equals("prop"));
		Assert.assertTrue(syntaxTreeVisitor.isDot);
	}
}
